/*
 * @author Nieves Grinan Garrido
 */
package formula_urjc;


import clases.Piloto;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import static java.lang.Integer.parseInt;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Senpai
 */
public class ModificarPiloto extends javax.swing.JFrame {

    /**
     * Creates new form ModificacionEscuderia
     */
    private Piloto piloto;
    FileInputStream fis;
    DataInputStream entrada;
    public ModificarPiloto() {
        initComponents();
    }
     public ModificarPiloto(String nombre) throws IOException {
        initComponents();
        try{
            fis = new FileInputStream("piloto.dat");
            entrada = new DataInputStream(fis);
            
            int n= 0;
            while (n!=-1) { 
                piloto = leerFichero(entrada);
                if((piloto==null)||(piloto.getNombre().equals(""))){
                    n = -1;
                }else 
                    if(piloto.getNombre().equals(nombre)){
                        this.tNombre.setText(piloto.getNombre());
                        this.tApellidos.setText(piloto.getApellidos());
                        this.tPeso.setText(piloto.getPeso().toString());
                        this.tEdad.setText(piloto.getEdad().toString());
                        this.tAltura.setText(piloto.getAltura().toString());
                        this.tValoracion.setText(piloto.getValoracion().toString());
                        this.tReflejos.setText(piloto.getReflejos().toString());
                        this.tAgresividad.setText(piloto.getAgresividad().toString());
                        this.tPaciencia.setText(piloto.getPaciencia().toString());
                        this.tValentia.setText(piloto.getValentia().toString());
                        if(piloto.getTipo().equals("Oficial")){
                          this.comboTipo.setSelectedIndex(0);
                          this.comboTipo.repaint();
                        }else{
                          this.comboTipo.setSelectedIndex(1);  
                        }
                        n=-1;
                    }
            }
            
        }catch (FileNotFoundException | EOFException ex) {
            Logger.getLogger(ModificarPiloto.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        tValentia = new javax.swing.JTextField();
        tAgresividad = new javax.swing.JTextField();
        comboTipo = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        tNombre = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        tApellidos = new javax.swing.JTextField();
        tAltura = new javax.swing.JTextField();
        tPeso = new javax.swing.JTextField();
        tEdad = new javax.swing.JTextField();
        tValoracion = new javax.swing.JTextField();
        tReflejos = new javax.swing.JTextField();
        tPaciencia = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        tSueldo = new javax.swing.JTextField();
        bCancelar1 = new javax.swing.JButton();
        bAceptar1 = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        bValorar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Modificar de piloto");

        tValentia.setPreferredSize(new java.awt.Dimension(50, 20));

        tAgresividad.setPreferredSize(new java.awt.Dimension(50, 20));

        comboTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecciona tipo", "Oficial", "Probador" }));
        comboTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboTipoActionPerformed(evt);
            }
        });

        jLabel8.setText("Tipo");

        tNombre.setPreferredSize(new java.awt.Dimension(100, 20));

        jLabel9.setText("Nombre");

        jLabel10.setText("Apellidos");

        tApellidos.setPreferredSize(new java.awt.Dimension(40, 20));
        tApellidos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tApellidosActionPerformed(evt);
            }
        });

        tAltura.setPreferredSize(new java.awt.Dimension(60, 20));

        tPeso.setPreferredSize(new java.awt.Dimension(60, 20));

        tEdad.setPreferredSize(new java.awt.Dimension(60, 20));
        tEdad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tEdadActionPerformed(evt);
            }
        });

        tValoracion.setEnabled(false);
        tValoracion.setPreferredSize(new java.awt.Dimension(40, 20));
        tValoracion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tValoracionActionPerformed(evt);
            }
        });

        tReflejos.setMinimumSize(new java.awt.Dimension(50, 20));
        tReflejos.setPreferredSize(new java.awt.Dimension(50, 20));

        tPaciencia.setPreferredSize(new java.awt.Dimension(50, 20));

        jLabel11.setText("Paciencia");

        jLabel12.setText("Reflejos");

        jLabel13.setText("Sueldo");

        tSueldo.setEnabled(false);
        tSueldo.setPreferredSize(new java.awt.Dimension(100, 20));

        bCancelar1.setText("Cancelar");
        bCancelar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bCancelar1ActionPerformed(evt);
            }
        });

        bAceptar1.setText("Aceptar");
        bAceptar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAceptar1ActionPerformed(evt);
            }
        });

        jLabel14.setText("Edad");

        jLabel15.setText("Valoración");

        jLabel16.setText("Peso");

        jLabel17.setText("Agresividad");

        jLabel18.setText("Valentía");

        jLabel19.setText("Altura");

        bValorar.setText("Valoración");
        bValorar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bValorarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19)
                            .addComponent(jLabel16)
                            .addComponent(jLabel14))
                        .addGap(34, 34, 34)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tSueldo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tValoracion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(154, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(comboTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(22, 22, 22))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(bValorar)
                        .addGap(63, 63, 63))))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(1, 1, 1)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel12)
                                .addComponent(jLabel11))
                            .addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(tPaciencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(tReflejos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(37, 37, 37)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel17)
                                    .addGap(18, 18, 18)
                                    .addComponent(tAgresividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                    .addComponent(jLabel18)
                                    .addGap(18, 18, 18)
                                    .addComponent(tValentia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jLabel15)))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(bAceptar1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(bCancelar1))
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel9)
                                .addComponent(jLabel10))
                            .addGap(22, 22, 22)
                            .addComponent(tNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(127, 127, 127)
                            .addComponent(jLabel8)))
                    .addContainerGap(136, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(20, 20, 20)
                .addComponent(comboTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(9, 9, 9)
                .addComponent(tApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(tAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(tPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(tEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(tValoracion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
                .addComponent(bValorar)
                .addGap(25, 25, 25)
                .addComponent(tSueldo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(50, 50, 50))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(41, 41, 41)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel9)
                                .addComponent(tNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(29, 29, 29))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel10)))
                    .addGap(118, 118, 118)
                    .addComponent(jLabel15)
                    .addGap(21, 21, 21)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tReflejos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel12)
                        .addComponent(tAgresividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel17))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel11)
                        .addComponent(tValentia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel18)
                        .addComponent(tPaciencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jLabel13)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(bAceptar1)
                        .addComponent(bCancelar1))
                    .addContainerGap()))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void comboTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboTipoActionPerformed
        if(!tValoracion.getText().equals("")){
           Integer sueldo = parseInt(tValoracion.getText()) * 50;
           if(comboTipo.getSelectedIndex()!=0 && comboTipo.getSelectedIndex()!=2){
               sueldo = sueldo + 50;
           }
           tSueldo.setText(sueldo.toString());
        }
    }//GEN-LAST:event_comboTipoActionPerformed

    private void tApellidosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tApellidosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tApellidosActionPerformed

    private void tEdadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tEdadActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tEdadActionPerformed

    private void tValoracionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tValoracionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tValoracionActionPerformed

    private void bCancelar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bCancelar1ActionPerformed
        ListaPilotoForm l = new ListaPilotoForm();
        l.setVisible(true);

    }//GEN-LAST:event_bCancelar1ActionPerformed

    private void bAceptar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAceptar1ActionPerformed
        try {
            //Recogemos los datos del formulario
            String nombre = tNombre.getText();
            String apellidos = tApellidos.getText();
            Integer edad = parseInt(tEdad.getText());
            Integer peso = parseInt(tPeso.getText());
            Integer altura = parseInt(tAltura.getText());
            Integer valoracion = parseInt(tEdad.getText());
            Integer agresividad = parseInt(tEdad.getText());
            Integer paciencia = parseInt(tEdad.getText());
            Integer reflejos = parseInt(tEdad.getText());
            Integer valentia = parseInt(tEdad.getText());
            Integer sueldo = parseInt(tEdad.getText());
            String tipo = comboTipo.getSelectedItem().toString();

            Piloto piloAux = new Piloto(nombre, apellidos , edad, peso, altura,
                0, valoracion, agresividad, paciencia, reflejos, valentia, sueldo,tipo);
            modificarRegistro(piloAux);

            ListaPilotoForm pilotoForm = new ListaPilotoForm();
            this.setVisible(false);
            pilotoForm.setVisible(true);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(AltaPiloto.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(AltaPiloto.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_bAceptar1ActionPerformed

    private void bValorarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bValorarActionPerformed
        Integer suma = parseInt(tAgresividad.getText()) + parseInt(tReflejos.getText()) +
        parseInt(tPaciencia.getText()) + parseInt(tValentia.getText());
        tValoracion.setText(suma.toString());
        Integer sueldo = suma * 50;
        if(comboTipo.getSelectedIndex()==1){
            sueldo = sueldo + 50;
            tSueldo.setText(sueldo.toString());
        }else{
            tSueldo.setText(sueldo.toString());
        }

    }//GEN-LAST:event_bValorarActionPerformed
private void modificarRegistro(Piloto piloIn) 
                                          throws IOException {
        FileOutputStream fos = null;
        FileInputStream fis = null;
        DataOutputStream salida = null;
        DataInputStream entrada = null;
        Piloto piloAux = null;
        ArrayList<Piloto> lista = null;
        piloAux=piloto;
        try{
            fis = new FileInputStream("piloto.dat");  
            entrada = new DataInputStream(fis);
            lista = new ArrayList();
            int n = 0;
            while (n!=-1) { 
                piloAux = leerFichero(entrada);
                if((piloAux==null)||(piloAux.getNombre().equals(""))){
                    n = -1;
                }else 
                    if(!piloto.getNombre().equals(piloAux.getNombre())){
                        lista.add(piloAux); 
                    }
            }
            fos = new FileOutputStream("piloto.dat");
            salida = new DataOutputStream(fos);
            Iterator<Piloto> nombreIterator = lista.iterator();
            while(nombreIterator.hasNext()){
               Piloto elemento = nombreIterator.next();
               salida.write(elemento.toBytes());
            }
            salida.write(piloto.toBytes());
        } catch (FileNotFoundException | EOFException ex) {
            Logger.getLogger(ModificarPiloto.class.getName()).log(Level.SEVERE, null, ex);
        }  finally {
            try {
                if (fis != null) {
                    fis.close();
                }
                if (fos != null) {
                    fos.close();
                }
                if (entrada != null) {
                    entrada.close();
                }
                if (salida != null) {
                    salida.close();
                }
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
     
        }
}
    private Piloto leerFichero(DataInputStream raf) throws IOException {
                byte[] record = new byte[Piloto.SIZE];
                raf.read(record);
                return Piloto.fromBytes(record);
  }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ModificarEscuderia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ModificarEscuderia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ModificarEscuderia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ModificarEscuderia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ModificarEscuderia().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bAceptar1;
    private javax.swing.JButton bCancelar1;
    private javax.swing.JButton bValorar;
    private javax.swing.JComboBox comboTipo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JTextField tAgresividad;
    private javax.swing.JTextField tAltura;
    private javax.swing.JTextField tApellidos;
    private javax.swing.JTextField tEdad;
    private javax.swing.JTextField tNombre;
    private javax.swing.JTextField tPaciencia;
    private javax.swing.JTextField tPeso;
    private javax.swing.JTextField tReflejos;
    private javax.swing.JTextField tSueldo;
    private javax.swing.JTextField tValentia;
    private javax.swing.JTextField tValoracion;
    // End of variables declaration//GEN-END:variables
}
